import axios from "axios";

axios.defaults.baseURL = '/api'
axios.defaults.timeout = 4000
axios.interceptors.request.use(config => {
    return config;
}, error => {
    return Promise.reject(error)
})

axios.interceptors.response.use(res => res, error => {
    return Promise.reject(error)
})
export const $get = async(url, params) => await axios.get(url, { params })

export const $post = async(url, params) => await axios.post(url, params);